Skip to content

feat: implement bun preload script for native dev mode#133

Merged
nadilas merged 1 commit intomainfrom
feat/implement-bun-run-warpgrid-native-dev-mode-us-611-v6uc82klbmfb30jpxv5vzr3l
Mar 15, 2026
Merged

feat: implement bun preload script for native dev mode#133
nadilas merged 1 commit intomainfrom
feat/implement-bun-run-warpgrid-native-dev-mode-us-611-v6uc82klbmfb30jpxv5vzr3l

Conversation

@tervezo-ai
Copy link
Copy Markdown
Contributor

@tervezo-ai tervezo-ai bot commented Mar 15, 2026

Summary

  • Adds @warpgrid/bun-sdk/preload module — a Bun preload script that configures WarpGrid for native development mode
  • Sets WARPGRID_MODE=development env var and initializes globalThis.warpgrid namespace with { mode: "development" }
  • Ensures __WARPGRID_WASM__ is NOT set so detectMode() returns "native" in Bun environments
  • Adds "./preload" export to package.json for bun run --preload @warpgrid/bun-sdk/preload and bunfig.toml usage

Test plan

  • 9 new tests in tests/preload.test.ts covering:
    • Environment variable setup (WARPGRID_MODE=development)
    • globalThis.warpgrid initialization and shape
    • Native mode detection (__WARPGRID_WASM__ not set)
    • Idempotency (double-import safety)
    • Existing property preservation
    • Handler integration with detectMode()
    • Module-load simulation (bun run --preload)
  • All 195 tests pass (9 new + 186 existing)
  • TypeScript typecheck passes

Resolves #80

🤖 Generated with Claude Code

Add @warpgrid/bun-sdk/preload module that registers WarpGrid shims for
native development mode. The preload script sets WARPGRID_MODE=development,
initializes globalThis.warpgrid namespace, and ensures detectMode() returns
"native" in Bun environments.

Resolves #80

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@nadilas nadilas merged commit 0238aeb into main Mar 15, 2026
3 of 10 checks passed
@nadilas nadilas deleted the feat/implement-bun-run-warpgrid-native-dev-mode-us-611-v6uc82klbmfb30jpxv5vzr3l branch March 15, 2026 09:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

US-611: Implement bun run --warpgrid native dev mode

1 participant